package cn.mymall.constant;

import org.apache.commons.collections.map.UnmodifiableMap;

import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;

public class MallConstant {

	public static final String TINGS_TYPE_ENTITY = "entity";
	public static final String TINGS_TYPE_ELEC = "elec";

	public static final String TINGS_TYPE_ELEC_MANUAL = "elec_manual";
	public static final String TINGS_TYPE_DAIGOU = "daigou";

	public static final String COOKIE_CART_ITEM = "cart_item";

	public static final String PRODUCT_STATUS_ON_SALE = "Y"; // 上架
	public static final String PRODUCT_STATUS_OFF_SALE = "N"; // 下架

	public static final String SKU_STATUS_ON_SALE = "Y"; // 上线
	public static final String SKU_STATUS_OFF_SALE = "N"; // 下线

	public static final String MODULE_MOVIE = "movie";
	public static final String MODULE_CATE = "cate";
	public static final String MODULE_BOOK = "book";
	public static final String MODULE_MALL = "mall";
	public static final String MODULE_MEMBERCHARGE = "membercharge";
	public static final String MODULE_DRAMA = "drama";


	// 代售
	// 经销（采购产品）
	// 预售（非完结订单，可能是前期定金，或后期尾款）
	public static final String PRODUCT_SALE_MODEL_PROXY = "agent"; // 代售
	public static final String PRODUCT_SALE_MODEL_SLEF = "distributor"; // 经销

	//蛋糕分类ID
	public static final Integer CATEGORY_CAKE_ID = 55;
	//图书分类ID
	public static final Integer CATEGORY_BOOK_ID = 65;

	public static Map<String, String> shipStatusMap;
	public static Map<String, String> saleModelShowMap;
	public static Map<String,String> productStatusMap;

	public static Map<String, String> orderstatusMap;
	public static Map<String, String> expressstatusMap;

	public static final Integer CART_ITEM_MAX=50;


	public static final String ORDERSTATUS_PAID = "paid";
	public static final String ORDERSTATUS_PAID_SUCCESS = "paid_success";
	public static final String ORDERSTATUS_PAID_RETURN = "paid_return";
	public static final String ORDERSTATUS_CANCEL = "cancel";
	public static final String ORDERSTATUS_NEW = "new";
	//通知第三方发货成功
	public static final String ORDERSTATUS_PAID_NOTIFY_SUCCESS= "paid_notify_success";
	//通知第三方发货失败
	public static final String ORDERSTATUS_PAID_NOTIFY_FAIL= "paid_notify_fail";


	public static final String EXPRESSSTATUS_WAIT = "wait";
	public static final String EXPRESSSTATUS_SEND = "send";
	public static final String EXPRESSSTATUS_SEND_PART = "send_part";
	public static final String EXPRESSSTATUS_RECEIVE = "receive";
	public static final String EXPRESSSTATUS_NOTIFY_SEND = "notify_send";
	public static final String EXPRESSSTATUS_REFUND = "refund";
	public static final String EXPRESSSTATUS_WAIT_REFUND = "wait_refund";

	public static final String EXPRESSSTATUS_ING_REFUND = "ing_refund";

	public static final String Delivery_Province_Mode_exclude = "exclude";
	public static final String Delivery_Province_Mode_include = "include";

	public static  String JD_REQ_URL = "https://item.m.jd.com/product/%s.html";
//	public static  String JD_REQ_URL = "https://p.3.cn/prices/mgets?skuIds=J_%s&type=1";

	public static final String PANDAYOUFU_PRODUCT_UPDATE_LAST_TIME = "key_mall_pandayoufu_product_update_time";

	static {

		LinkedHashMap<String, String> tmpShipStatus = new LinkedHashMap<>();

		shipStatusMap = UnmodifiableMap.decorate(tmpShipStatus);

		Map<String, String> tmpSaleModelShowMap = new HashMap<>();
		tmpSaleModelShowMap.put(PRODUCT_SALE_MODEL_PROXY, "代售");
		tmpSaleModelShowMap.put(PRODUCT_SALE_MODEL_SLEF, "经销");

		saleModelShowMap = UnmodifiableMap.decorate(tmpSaleModelShowMap);

		LinkedHashMap<String, String> tmpOrderstatusMap = new LinkedHashMap<>();
		tmpOrderstatusMap.put(ORDERSTATUS_PAID, "已支付");
		tmpOrderstatusMap.put(ORDERSTATUS_PAID_SUCCESS, "交易成功");
		tmpOrderstatusMap.put(ORDERSTATUS_PAID_RETURN, "已退款");
		tmpOrderstatusMap.put(ORDERSTATUS_CANCEL,"已取消");
		tmpOrderstatusMap.put(ORDERSTATUS_NEW,"待支付");
		orderstatusMap = UnmodifiableMap.decorate(tmpOrderstatusMap);


		LinkedHashMap<String, String> tmpExpressstatusMap = new LinkedHashMap<>();
		tmpExpressstatusMap.put(EXPRESSSTATUS_WAIT, "待发货");
		tmpExpressstatusMap.put(EXPRESSSTATUS_SEND_PART, "部分发货");
		tmpExpressstatusMap.put(EXPRESSSTATUS_SEND, "已发货");
		tmpExpressstatusMap.put(EXPRESSSTATUS_RECEIVE, "已收货");
		tmpExpressstatusMap.put(EXPRESSSTATUS_NOTIFY_SEND,"通知发货中");
		tmpExpressstatusMap.put(EXPRESSSTATUS_REFUND,"已退款");
		tmpExpressstatusMap.put(EXPRESSSTATUS_WAIT_REFUND,"等待退款");
		tmpExpressstatusMap.put(EXPRESSSTATUS_ING_REFUND,"退款处理中");
		expressstatusMap = UnmodifiableMap.decorate(tmpExpressstatusMap);


		Map<String, String> tmpProductStatusMap = new HashMap<String, String>(6);
		tmpProductStatusMap.put(PRODUCT_STATUS_OFF_SALE, "商品下架");
		tmpProductStatusMap.put(PRODUCT_STATUS_ON_SALE, "商品上架");
		productStatusMap = Collections.unmodifiableMap(tmpProductStatusMap);
	}
}
